package com.ewzj.bigdata.mvp.model.rspbean;

import com.chad.library.adapter.base.entity.MultiItemEntity;

import java.util.List;

/**
 * author:zhangjing
 * 作用:
 * return:
 */

public class CollectionBean implements MultiItemEntity {


    private int table_id;
    private int id;
    private JsonContentEntity json_content;
    private String create_time;
    private int is_collect;

    public int getTable_id() {
        return table_id;
    }

    public void setTable_id(int table_id) {
        this.table_id = table_id;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public JsonContentEntity getJson_content() {
        return json_content;
    }

    public void setJson_content(JsonContentEntity json_content) {
        this.json_content = json_content;
    }

    public String getCreate_time() {
        return create_time;
    }

    public void setCreate_time(String create_time) {
        this.create_time = create_time;
    }

    public int getIs_collect() {
        return is_collect;
    }

    public void setIs_collect(int is_collect) {
        this.is_collect = is_collect;
    }

    @Override
    public int getItemType() {
//        新房
        if (table_id==1){
            return 1;
//            二手房
        }else if (table_id==8){
            return 2;
        }else if (table_id==9){
//            租房
            return 3;
        }else
            return 0;

    }

    public static class JsonContentEntity {
        /**
         * is_self : 0
         * go_url : http://192.168.0.221:3001/lp/8
         * three_url : http://zh.fang.anjuke.com/loupan/254673.html
         * thumb : http://pic1.ajkimg.com/display/xinfang/e3df3a31318595e3ccd1d7979691716f/800x600m.jpg
         * name : 格力海岸
         * region : 香洲区
         * address : 广东省珠海市香洲区情侣北路
         * house_tags : [{"tag_name":"普通住宅","color":"#85c6dc"}]
         * price : 38000元/平
         * area : 面积未知
         * sources : 安居客
         * lon : 113.629140
         * lat : 22.355783
         */
        private String title;
        private String video;
        private String duration;
        private int type_id;
        private int id;
        private String go_url;
        private int groupId;
        private String three_url;
        private String house_type;
        private String thumb;
        private String name;
        private String layout;
        private String area;
        private String house_orien;
        private String house_name;
        private String total_price;
        private String price;
        private String map_level;
        private int sum;
        private String region;
        private String address;
        private String rent_type;
        private String sources;
        private int visit;
        private Double lon;
        private Double lat;
        private int is_self;
        private int is_collect;
        private String section;

        public String getTotal_price() {
            return total_price;
        }

        public void setTotal_price(String total_price) {
            this.total_price = total_price;
        }

        private List<HomeBean.HouseTagsEntity> house_tags;

        public String getVisit() {
            return visit+"";
        }

        public void setVisit(int visit) {
            this.visit = visit;
        }

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public int getGroupId() {
            return groupId;
        }

        public void setGroupId(int groupId) {
            this.groupId = groupId;
        }

        public String getHouse_type() {
            return house_type;
        }

        public void setHouse_type(String house_type) {
            this.house_type = house_type;
        }

        public String getLayout() {
            return layout;
        }

        public void setLayout(String layout) {
            this.layout = layout;
        }

        public String getHouse_orien() {
            return house_orien;
        }

        public void setHouse_orien(String house_orien) {
            this.house_orien = house_orien;
        }

        public String getHouse_name() {
            return house_name;
        }

        public void setHouse_name(String house_name) {
            this.house_name = house_name;
        }

        public String getMap_level() {
            return map_level;
        }

        public void setMap_level(String map_level) {
            this.map_level = map_level;
        }

        public int getSum() {
            return sum;
        }

        public void setSum(int sum) {
            this.sum = sum;
        }

        public String getRent_type() {
            return rent_type;
        }

        public void setRent_type(String rent_type) {
            this.rent_type = rent_type;
        }

        public int getIs_self() {
            return is_self;
        }

        public void setIs_self(int is_self) {
            this.is_self = is_self;
        }

        public int getIs_collect() {
            return is_collect;
        }

        public void setIs_collect(int is_collect) {
            this.is_collect = is_collect;
        }

        public String getSection() {
            return section;
        }

        public void setSection(String section) {
            this.section = section;
        }

        public String getGo_url() {
            return go_url;
        }

        public void setGo_url(String go_url) {
            this.go_url = go_url;
        }

        public String getThree_url() {
            return three_url;
        }

        public void setThree_url(String three_url) {
            this.three_url = three_url;
        }

        public String getThumb() {
            return thumb;
        }

        public void setThumb(String thumb) {
            this.thumb = thumb;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getRegion() {
            return region;
        }

        public void setRegion(String region) {
            this.region = region;
        }

        public String getAddress() {
            return address;
        }

        public void setAddress(String address) {
            this.address = address;
        }

        public String getPrice() {
            return price;
        }

        public void setPrice(String price) {
            this.price = price;
        }

        public String getArea() {
            return area;
        }

        public void setArea(String area) {
            this.area = area;
        }

        public String getSources() {
            return sources;
        }

        public void setSources(String sources) {
            this.sources = sources;
        }

        public Double getLon() {
            return lon;
        }

        public void setLon(Double lon) {
            this.lon = lon;
        }

        public Double getLat() {
            return lat;
        }

        public void setLat(Double lat) {
            this.lat = lat;
        }

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public String getVideo() {
            return video;
        }

        public void setVideo(String video) {
            this.video = video;
        }

        public String getDuration() {
            return duration;
        }

        public void setDuration(String duration) {
            this.duration = duration;
        }

        public int getType_id() {
            return type_id;
        }

        public void setType_id(int type_id) {
            this.type_id = type_id;
        }

        public List<HomeBean.HouseTagsEntity> getHouse_tags() {
            return house_tags;
        }

        public void setHouse_tags(List<HomeBean.HouseTagsEntity> house_tags) {
            this.house_tags = house_tags;
        }
    }


    public VideoBean collect2Videobean(){
        VideoBean videoBean=new VideoBean();
        videoBean.setGo_url(getJson_content().getGo_url());
        videoBean.setIs_self(getJson_content().getIs_self());
        videoBean.setThree_url(getJson_content().getThree_url());
        videoBean.setVideo(getJson_content().getVideo());
        videoBean.setTitle(getJson_content().getTitle());
        videoBean.setDuration(getJson_content().getDuration());
        videoBean.setGroupId(getJson_content().getGroupId()+"");
        videoBean.setId(getJson_content().id+"");
        videoBean.setIs_collect(getIs_collect());
        videoBean.setThumb(getJson_content().getThumb());
        return videoBean;
    }
    public InfoBean collect2Infobean(){
        InfoBean infoBean=new InfoBean();
        infoBean.setGo_url(getJson_content().getGo_url());
        infoBean.setIs_self(getJson_content().getIs_self());
        infoBean.setThree_url(getJson_content().getThree_url());
        infoBean.setVideo(getJson_content().getVideo());
        infoBean.setTitle(getJson_content().getTitle());
        infoBean.setDuration(getJson_content().getDuration());
        infoBean.setGroupId(getJson_content().getGroupId()+"");
        infoBean.setId(getJson_content().id+"");
        infoBean.setSources(getJson_content().getSources());
        infoBean.setThumb(getJson_content().getThumb());
        infoBean.setType_id(getJson_content().type_id);
        infoBean.setIs_collect(getIs_collect());
        return infoBean;
    }
    public HomeBean collect2hoursebean(){
        HomeBean hourseBean=new HomeBean();
        hourseBean.setIs_self(getJson_content().getIs_self());
        hourseBean.setName(getJson_content().name);
        hourseBean.setThree_url(getJson_content().three_url);
        hourseBean.setGo_url(getJson_content().go_url);
        hourseBean.setIs_collect(is_collect);
        hourseBean.setGroupId(getJson_content().groupId);
        hourseBean.setSources(getJson_content().getSources());
        hourseBean.setId(getJson_content().id);
        hourseBean.setThumb(getJson_content().getThumb());
        hourseBean.setIs_collect(getIs_collect());
//        hourseBean.setTitle(getJson_content().getTitle());
        return hourseBean;
    }
}
